#ifndef FUNCMODEL_H
#define FUNCMODEL_H


#include <Eigen/Dense>
#include <cmath>
namespace QPCRModel {


class funcModel{

public:
    funcModel();
    virtual ~funcModel();

    virtual double f(double x) = 0;
    virtual double g(double y) = 0;

    virtual double loss(double x, double y) = 0;
    virtual double loss(double x, double y, const Eigen::VectorXd &X) = 0;

    virtual double loss2(double x, double y) = 0;
    virtual double loss2(double x, double y, const Eigen::VectorXd &X) = 0;

    virtual double diff1(double x) = 0;
    virtual double diff2(double x) = 0;

    virtual Eigen::VectorXd jacobian(double x, double y) = 0;
    virtual Eigen::VectorXd jacobian2(double x, double y) = 0;

public:
    virtual void setV(const Eigen::VectorXd &v) = 0;
    virtual Eigen::VectorXd getV() = 0;

    virtual int getParamNum() = 0;

    virtual double curvity(double x, double norm_coef) = 0;

    virtual double getLinearStageFunc(double *lk, double *lb) = 0;

    //virtual std::vector<std::pair<double, double>> getRange();


    virtual std::pair<double, double> getRange(int i) = 0; // 获取参数取值范围
    virtual void init(double SPE, double EPE, int cycleNum, double ymin, double ymax) = 0;            // 初始化参数值


public:


    double a;
    double b;
    double x0;
    double y0;
    double d;

};




}


#endif // FUNCMODEL_H
